    .file   1 "simple-comp.c"

 # GNU C 2.7.2.3 [AL 1.1, MM 40, tma 0.1] SimpleScalar running sstrix compiled by GNU C

 # Cc1 defaults:
 # -mgas -mgpOPT

 # Cc1 arguments (-G value = 8, Cpu = default, ISA = 1):
 # -quiet -dumpbase -O0 -o

gcc2_compiled.:
__gnu_compiled_c:
    .sdata
    .align  2
$LC0:
    .ascii  "%d\n\000"
    .text
    .align  2
    .globl  main

    .text

    .loc    1 4
    # .ent new function marker (for debugger)
    .ent    main
    # function label
main:
    # .frame: framepointer, frame size(from fp), return address register
    .frame  $fp,32,$31      # vars= 8, regs= 2/0, args= 16, extra= 0
    # (for compiler) bitmask of registers are saved, 31(ra) and 30(fp)
    .mask   0xc0000000,-4
    # same for floats
    .fmask  0x00000000,0
    # Function prologue. create stackframe (grows downwards)
    subu    $sp,$sp,32
    # save ra and fp registers at framesize - 4 (see mask)
    sw  $31,28($sp)
    sw  $fp,24($sp)
    # set frame pointer
    move    $fp,$sp
    # call system specific init in __main (c++ constructors)
    jal __main

    # S = 10 ($2 == 10)
    li  $2,0x0000000a       # 10
    # S is saved in stackframe at offset 16
    sw  $2,16($fp)
    # for loop init step
    # $0 is always 0. 'i' is saved at offset 20
    sw  $0,20($fp)
$L2:
    # load i into $2 (No DataFlow Analysis done)
    lw  $2,20($fp)
    # for loop condition check:
    # branch to L5 if $2 < 10 else jump to L3
    slt $3,$2,10
    bne $3,$0,$L5
    j   $L3
$L5:
    # for loop body: S = S + i
    lw  $2,16($fp) # S
    lw  $3,20($fp) # i
    addu    $2,$2,$3
    sw  $2,16($fp)
$L4:
    # for loop's i++
    lw  $3,20($fp)
    addu    $2,$3,1
    move    $3,$2
    sw  $3,20($fp)
    j   $L2
    # for loop exit
$L3:
    la  $4,$LC0
    lw  $5,16($fp)
    jal printf
    move    $2,$0
	#########START added by LOrenzo
    #1
	shift $regA,$regA,0
	#2
	move $regA,$regB
	instr $regA,$regA,0
	#3
	sw $regA,$regB
	ld $regA,$regB
	#4
	addu $2,$2,5
	lw  $3,0($2)
	#5
	beq $2,$3,$L1
    j   $L2
	#6
	instr $regA,$regB,0	
	move $4,$regA
	jal __main
	#########END added by LOrenzo

$L1:
    # function epilogue: restore regs and break down stackframe
    move    $sp,$fp         # sp not trusted here
    # restore $ra and $fp from stack.
    lw  $31,28($sp)
    lw  $fp,24($sp)
    # remove this stackframe
    addu    $sp,$sp,32
    j   $31
    .end    main
